/**
 *  @file controller.h
 *
 *  @date 16-nov-2009
 *  @author Ives van der Flaas
 */

#ifndef CONTROLLER_H_
#define CONTROLLER_H_

#include "vector2.h"

namespace si
{

/**
 * Abstract class that'll represent every kind of movement in the game. A bullet
 * will be controlled by a simple LinearController, the player's ship will be
 * controlled by a KeyboardController, so on and so forth.
 */
class Controller
{

public:
	/**
	 * Constructor that initializes the controller at given position
	 * position Virtual position of the controller
	 * size Virtual size of the controller
	 * @return
	 */
	Controller(Vector2 position, Vector2 size);
	virtual ~Controller();

	/**
	 * This function will be called every frame and will update the object
	 * this controller controls.
	 * @param time Time passed since last call of update();
	 */
	virtual void update(const double time) = 0;

	Vector2 getPosition() const { return fPosition; }
	void setPosition(Vector2 newPosition) { fPosition = newPosition; }

protected:
	Vector2 fPosition;
	Vector2 fSize;
};

}

#endif /* CONTROLLER_H_ */
